package Work;
import java.util.Scanner;
import java.lang.Integer;

public class Pro2 {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (true) {
			String str1 = in.nextLine();
			Integer num = new Integer(str1);
			if (num >= 10000 && num <= 20000) {
				System.out.print(Integer.toBinaryString(num) + ",");
				System.out.print(Integer.toOctalString(num) + ",");
				System.out.println(Integer.toHexString(num));
			} else {
				int sum = 0;
				char a[] = str1.toCharArray();
				for (int i = 0; i < str1.length(); ++i) {
					if (a[i] >= '0' && a[i] <= '9') {
						int temp = a[i] - '0';
						sum += temp;
						System.out.print(temp + " ");
					}
				}
				System.out.println(sum);
			}
		}
	}
}